package cn.gjxblog.api;


import cn.gjxblog.common.model.HttpResult;
import cn.gjxblog.model.dto.HouseQueryDTO;
import cn.gjxblog.model.entity.City;
import cn.gjxblog.model.entity.Community;
import cn.gjxblog.model.entity.House;
import cn.gjxblog.model.entity.HouseMsg;
import cn.gjxblog.model.vo.HouseVO;
import com.github.pagehelper.PageInfo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author gjx
 * @version v1.0
 * @Description
 * @date 2018/12/13 14:09
 */
@FeignClient(value = "house-server",path = "/house")
public interface HouseServerFegin {


    @PostMapping("/searchHouses")
    HttpResult<PageInfo<HouseVO>> searchHouses(@RequestBody HouseQueryDTO houseQueryDTO );

    @RequestMapping("/getHouse")
    HttpResult<HouseVO> getHouse(@RequestParam("id")String houseId);


    @GetMapping("/queryCommunitys")
    HttpResult<List<Community>> queryCommunitys();

    @GetMapping("/queryCitys")
    HttpResult<List<City>> queryCitys();

    /**
     * 房产新增
     * @param house
     * @return
     */
    @PostMapping("/addHouse")
    HttpResult addHouse(@RequestBody House house,@RequestParam("userId") String userId);

    @GetMapping("/queryHotHouses")
    HttpResult<List<HouseVO>> queryHotHouses(@RequestParam("size") Integer size);




    @PostMapping("/queryHousesByUserId")
    HttpResult<PageInfo<HouseVO>> queryHousesByUserId(@RequestBody HouseQueryDTO houseQueryDTO);

    @PostMapping("/queryLastestHouses")
    HttpResult<List<HouseVO>> queryLastestHouses();
    @PostMapping("/queryGoodHouses")
    HttpResult<List<HouseVO>> queryGoodHouses();
    @PostMapping("/addHouseMsg")
    HttpResult<Object> addHouseMsg(@RequestBody HouseMsg houseMsg);


    @GetMapping("/houseRate")
    HttpResult<Object> houseRate(@RequestParam("rating") Double rating,@RequestParam("hosueId") String houseId);

    @GetMapping("/collectHouse")
    HttpResult<Object> collectHouse(@RequestParam("houseId") String houseId,@RequestParam("userId") String userId,@RequestParam("b") boolean b);


    @GetMapping("/deleteHouse")
    HttpResult deleteHouse(@RequestParam("houseId")String houseId);
}
